package cn.t16.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;


@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result implements Serializable {
    /**
     * 200 - ok
     * ....
     */
    private Integer status;
    private String message;
    private Object data;
    public Result returnSuccess() {
        return returnResult(200,"success",null);
    }
    public static Result returnFailed() {
        return returnResult(500,"error",null);
    }
    public static Result returnResult(Integer status,String message) {
        return returnResult(status,message,null);
    }
    public static Result returnResult(Integer status,String message,Object data) {
        return new Result(status,message,data);
    }

}
